<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Exporting to a useable format</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<p>Once an application has been translated, selected languages or bundles can be exported to a usable format by clicking <strong>Generate</strong> in the main menu.</p>
<p>The form lets you select which bundles and languages to generate. The completion threshhold enables languages which are partially complete to be omitted from the generated zip file.</p>


<div class="contents">
  <h2>Contents</h2>
  <ol>
    <li><a href="#options">Options</a></li>
    <li><a href="#fx">Firefox XUL/JavaScript</a></li>
    <li><a href="#po">GNU Portable Object (PO)</a></li>
    <li><a href="#java">Java</a></li>
    <li><a href="#net">.NET</a></li>
    <li><a href="#netcf">.NET Compact Framework</a></li>
    <li><a href="#phparray">PHP Array</a></li>
    <li><a href="#phpdefinitions">PHP Definitions</a></li>
    <li><a href="Translating.an.Application.html#xmlxls">XML Spreadsheet</a></li>
  </ol>
</div>

<h2><a name="options">Options</a></h2>
<p><strong>Open output file/location</strong> - If checked, the resource file or directory will be opened on completion.</p>
<p><strong>Include Summary</strong> - Includes a summary of the generated resource files detailing the completion of each language with the output.</p>
<p><strong>Generate Neutral-Language Resource Files</strong> - For each bundle, generate additional files with no language codes to be used as the neutral/default language. Eg: If the default language is <em>en-GB</em>, for a bundle called <em>ErrorStrings</em>, <em>ErrorStrings.resx</em> or <em>ErrorStrings.properties</em> would be included</p>

<h2><a name="fx">Firefox XUL/JavaScript</a></h2>
<p>Each language for the application is contained within a different directory in the zip file. Only two bundles are used, <em>JavaScript</em> and <em>XUL</em>. In the directory for each language there is a JavaScript bundle called <em><span style="color:purple;">project-display-name</span>.properties</em>, a <em><span style="color:purple;">project-display-name</span>.dtd</em> document type definition for use within .xul files and a <em>contents.rdf</em>.</p>
<p>The <em><span style="color:purple;">ProjectDisplayName</span>.properties file</em> uses the same format as Java.</p>
<p><strong><span style="color:purple;">ProjectDisplayName</span>.dtd File Format</strong></p>
<pre>
&lt;!ENTITY <span style="color:#158F00;">ElementName</span> "<span style="color:#8F4000;">Translation for element</span>"&gt;
&lt;!ENTITY <span style="color:#158F00;">DifferentElementName</span> "<span style="color:#8F4000;">Translation for different element</span>"&gt;
</pre>
<p>For more information see <a href="Firefox.Format.html">Firefox format</a>.</p>
<hr />

<h2><a name="po">GNU Portable Object (PO)</a></h2>
<p>Each bundle is contained within a different directory in the generated zip file. The language of each bundle is used to generated the filenames. The element comment field is used to hold meta data including references, flags, the message context and any comments extracted from the source code.</p>
<p><strong>Filename</strong>: /<span style="color:#EF0E0E;">BundleName</span>/<span style="color:#1B1675;">language-code</span>.po</p>
<p><strong>File Format</strong></p>
<pre>
# translator comments
#. source code comments
#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:34
#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:97
msgctx "context info"
msgid "<span style="color:#8F4000;">Untranslated String</span>"
msgstr "<span style="color:#8F4000;">Translated String</span>"
</pre>
<p>For more information see <a href="PO.Format.html">GNU PO Format</a>.</p>
<hr />

<h2><a name="java">Java</a></h2>
<p>Exporting to Java creates .properties files. The bundle name and locale are used to determine the filename.</p>
<p><strong>Filename</strong>: <span style="color:#EF0E0E;">BundleName</span>_<span style="color:#1B1675;">language-code</span>.properties</p>
<p><strong>File Format</strong></p>
<pre>
<span style="color:#158F00;">ElementName</span>=<span style="color:#8F4000;">Translation for element</span>
<span style="color:#158F00;">AnotherElement</span>=<span style="color:#8F4000;">Translation for the second element</span>
</pre>
<p>For example: A bundle called <em>strings</em> in Czech would create a file called <em><span style="color:#EF0E0E;">strings</span>_<span style="color:#1B1675;">cs</span>.properties</em>.</p>
<p>For more information see <a href="Java.Format.html">Java format</a>.</p>
<hr />

<h2><a name="net">.NET</a></h2>
<p>.NET applications use .resx files. In the example above, the generated file would be called <em><span style="color:#EF0E0E;">strings</span>.<span style="color:#1B1675;">cs</span>.resx</em>.</p>
<p><strong>Filename</strong>: <span style="color:#EF0E0E;">BundleName</span>.<span style="color:#1B1675;">language-code</span>.resx</p>
<p><strong>File Format</strong></p>
<pre>
&lt;data name="<span style="color:#158F00;">ElementName</span>"&gt;
&lt;value&gt;<span style="color:#8F4000;">Translation</span>&lt;/value&gt;
&lt;/data&gt;
</pre>
<p>For more information see <a href="Resx.Format.html">.NET format</a>.</p>
<hr />

<h2><a name="netcf">.NET Compact Framework</a></h2>
<p>Same as .NET, but with some compatibility changes with some language codes.</p>

<h2><a name="phparray">PHP Array</a></h2>
<p>Elements are output to PHP files as key/value pairs in an array so they can be used with the print or echo functions. The generated PHP file must be include()d first.</p>
<p><strong>Filename</strong>: <span style="color:#EF0E0E;">BundleName</span>_<span style="color:#1B1675;">language-code</span>.php</p>
<p><strong>File Format</strong></p>
<pre>
&lt;&#63;php
$<span style="color:#EF0E0E;">BundleName</span> = array(
"<span style="color:#158F00;">ElementName</span>" =&gt; "<span style="color:#8F4000;">Translation for element</span>",
"<span style="color:#158F00;">AnotherElement</span>" =&gt; "<span style="color:#8F4000;">Translation for the second element</span>",
);
&#63;&gt;
</pre>
<hr />

<h2><a name="phpdefinitions">PHP Definitions</a></h2>
<p>Elements are output to PHP files as constants so they can be used with the print or echo functions. The generated PHP file just needs to be include()d first.</p>
<p><strong>Filename</strong>: <span style="color:#EF0E0E;">BundleName</span>_<span style="color:#1B1675;">language-code</span>.php</p>
<p><strong>File Format</strong></p>
<pre>
&lt;?php
define("<span style="color:#158F00;">ElementName</span>","<span style="color:#8F4000;">Translation for element</span>");
define("<span style="color:#158F00;">AnotherElement</span>","<span style="color:#8F4000;">Translation for the second element</span>");
?&gt;
</pre>

</body>
</html>

